<!--
  @author heguanghua
  @since 2019/06/12 11:57
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>


<div class="layui-fluid">

    <blockquote class="layui-crumb">
        渠道管理>
        <a lay-href="/channel/list.action">渠道管理</a>>
        <a th:href="'/channel/detail.action?channelId='+${obj.channelId}">[[${obj.name}]]</a>>
        <a th:href="|/channel/service/area/list.action?channelId=${obj.channelId}|">服务区域</a>>
        <zmn text="批量开通前台分类">批量开通前台分类</zmn>
    </blockquote>

    <div class="layui-card">

        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li th:class="${flag == 1 && showType == 2 ? 'layui-this' : ''}"><a th:href="|/channel/service/area/batchServiceCategory.action?serviceAreaIds=${serviceAreaIds}&showType=2&channelId=${channelId}|" lay-text="前台开通分类">前台开通分类</a></li>
            </ul>
        </div>

        <div class="layui-card-body">
            <form method="POST" action="" class="layui-form" lay-filter="zmn-form">

                <input type="hidden" name="channelId" th:value="${channelId}"/>
                <input type="hidden" name="showType" th:value="${showType}"/>

                <div class="layui-tab layui-tab-brief" lay-filter="servCategId">
                    <ul class="layui-tab-title">
                        <li th:each="servCategory,state:${servCategorys}" th:text="${servCategory.value}" th:lay-id="${servCategory.key}" th:class="${state.index == 0 ? 'layui-this' : ''}"/>
                    </ul>
                    <div class="layui-tab-content">
                        <div th:each="servCategory,state:${servCategorys}" th:class="${state.index == 0 ? 'layui-tab-item layui-show' : 'layui-tab-item'}">
                            <div class="layui-card-body">
                                <div class="inline-block" style="float: left">
                                    <div class="zmn-2layer-list" th:each="oneCateg:${servCategory.children}">
                                        <div class="list-left" style="text-align: center">
                                            <div class="list-item" th:text="${oneCateg.value}"></div>
                                        </div>
                                        <div class="list-right">
                                            <div class="right-box">
                                                <div class="list-item">
                                                    <input type="checkbox" class="checkAll" lay-filter="checkAll" th:value="${servCategory.key + '-' + oneCateg.key}" title="全选">
                                                </div>
                                                <div class="list-item" th:each="categ:${oneCateg.children}" th:title="${categ.value}">
                                                    <input type="checkbox" lay-filter="checkOne" name="categoryId" th:class="${servCategory.key + '-' + oneCateg.key}" th:value="|${servCategory.key}-${oneCateg.key}-${categ.key}|"
                                                            th:title="${categ.value}">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item submit" th:if="${#authPermit.checkPermit('/channel/serviceArea/serviceCategory/addEdit.action')}">
                    <div class="layui-input-block" style="margin-left: 139px">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>

            </form>

        </div>

    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">
    var json = {
        currentServCategId: [[${currentServCategId}]],
        serviceAreaIds: [[${serviceAreaIds}]]
    };

    layui.config({
        base: "/static/lay/",
        version: 201910241646
    }).extend({
        index: "lib/index",
        channel_batch_servicearea_category: "channel/servicearea/batch/zmn.plat.channel.servicearea.category",
    }).use(['index', 'channel_batch_servicearea_category']);

</script>
